home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / term-source.lha / OwnDevUnit.h < prev    next >
C/C++ Source or Header  |  1996-10-20  |  2KB  |  49 lines

  1. /* OwnDevUnit.h
  2.  
  3.    Created 2/10/91 by Christopher A. Wichura
  4. */
  5.  
  6. #ifndef EXEC_TYPES_H
  7. #include <exec/types.h>
  8. #endif
  9.  
  10. /* macro to grab the name of the library */
  11. #define ODU_NAME "OwnDevUnit.library"
  12.  
  13. /* strings that can be returned by LockDevUnit() and AttempDevUnit() to
  14.    indicate an internal error.  Note that these all start with a
  15.    special character to allow clients to only have to check one byte
  16.    to determine if an error occured. */
  17.  
  18. #define ODUERR_LEADCHAR "\x07"
  19.  
  20. #define ODUERR_NOMEM    ODUERR_LEADCHAR "Out of memory"
  21. #define ODUERR_NOTIMER    ODUERR_LEADCHAR "Unable to open timer.device"
  22. #define ODUERR_BADNAME    ODUERR_LEADCHAR "Bogus device name supplied"
  23. #define ODUERR_BADBIT    ODUERR_LEADCHAR "Bogus notify bit supplied"
  24. #define ODUERR_UNKNOWN    ODUERR_LEADCHAR "Unknown"
  25.                 /* returned if owner's name is NULL */
  26.  
  27. /* prototypes for the functions found in this library */
  28. UBYTE *LockDevUnit(UBYTE *Device, ULONG Unit, UBYTE *OwnerName, UBYTE NotifyBit);
  29. UBYTE *AttemptDevUnit(UBYTE *Device, ULONG Unit, UBYTE *OwnerName, UBYTE NotifyBit);
  30. void   FreeDevUnit(UBYTE *Device, ULONG Unit);
  31. void   NameDevUnit(UBYTE *Device, ULONG Unit, UBYTE *OwnerName);
  32. BOOL   AvailDevUnit(UBYTE *Device, ULONG Unit);
  33. UBYTE *OwnerDevUnit(UBYTE *Device, ULONG Unit);
  34.  
  35. #ifndef NO_PRAGMAS
  36. #ifndef  EXEC_LIBRARIES_H
  37. #include <exec/libraries.h>
  38. #endif
  39.  
  40. extern struct Library *OwnDevUnitBase;
  41.  
  42. #pragma libcall OwnDevUnitBase LockDevUnit    1E 190804
  43. #pragma libcall OwnDevUnitBase AttemptDevUnit 24 190804
  44. #pragma libcall OwnDevUnitBase FreeDevUnit    2A 0802
  45. #pragma libcall OwnDevUnitBase NameDevUnit    30 90803
  46. #pragma libcall OwnDevUnitBase AvailDevUnit   36 0802
  47. #pragma libcall OwnDevUnitBase OwnerDevUnit   42 0802
  48. #endif /* NO_PRAGMAS */
  49.